﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<!-- blueprint CSS framework -->
<!--<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />-->
<!--<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />-->
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
<!--<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/main.css" />-->
<!-- <link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/menu.css" />  -->
<!--[endif]-->
<!--<script type="text/javascript" src="<?php //echo Yii::app()->request->baseUrl; ?>/jquery.treeview.dropdown.js" />-->
<!--<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.treeview.css" />-->
<!--<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/lib/jquery.js" type="text/javascript"></script>-->
<!--<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/lib/jquery.cookie.js" type="text/javascript"></script>-->
<!--<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.treeview.js" type="text/javascript"></script>-->
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/default.css" />

<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>
<!--главное меню -->
<a href="javascript:scroll(0,0);" style = " position:fixed; bottom:25px; right:50px" ><img src="/images/up.png"></a>
<div id="header">
<!-- скругление углов -->
<ul id="left"></ul>
<ul id="right"></ul>
    <div class="menu_header left">
    <ul id="menu">  
    <?php if(!empty($_GET['keyword'])) $value = $_GET['keyword']; else $value =''; ?>     
   <!-- вывод главного меню -->
    <?php $this->widget('zii.widgets.CMenu',array(
        'items'=>array(
            array(
            'label'=>'Головна', 
            'url'=>array('/site/index'),
              ),
            array('label'=>'Про нас', 'url'=>array('/site/about')),
            array('label'=>'Контакти', 'url'=>array('/contact')), 
            array(
            'label'=>'Новини', 
            'url'=>array('/news/index'),
        ),     
            /*array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
            array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),*/
        ),
        'htmlOptions' => array('class' => 'menu'),
    )); ?> 
   </ul></div>
    <!-- форма поиска --> 
    <form id="search" method="get" name="search" action="/site/search">
        <fieldset>
            <input name="keyword" value="<?php echo $value?>" type="text" id="input1" />
            <input type="submit" id="input2" value="Пошук" />
        </fieldset>
    </form>
</div> 
<div class="clear"></div>
<div id="content"> 
<div class="right">
<?php
	$this->widget('zii.widgets.CBreadcrumbs', array(
        'links'=>$this->breadcrumbs,
		'homeLink'=>CHtml::link('Головна','/index' ),
        ));
?>		
</div>
    <div id="colOne">
        <div id="logo"></div>
        <div class="box">
        <!-- левое древовидное меню -->
<!--            <script type="text/javascript">
//                $(document).ready(function(){
//                    $('.menu_list').treeview({ animated: true, speed: "fast", collapsed: true, control: "#1",   persist: "cookie", cookieId: "navigationtree"});
//                });
            </script>-->

            <?php
            
             if(isset($_GET['topic'])){ 
                $parent_id = Theme::model()->findByPk($_GET['topic'])->parent_id;
                $collapse = $_GET['topic'];
             } else{
                 $collapse = 0;
                 $parent_id = 0;
             }
            $this->widget('application.extensions.MTreeView.MTreeView',array(
                    'collapsed'=>true,
                    'animated'=>'fast',
                    'id'=> 'menu_list',
                    'cookieId'=> 'textcookie',
                    'persist' => 'cookie',
                    //---MTreeView options from here
                    'table'=>'theme',//what table the menu would come from
                    'hierModel'=>'adjacency',//hierarchy model of the table
                    'conditions'=>array('visible=:visible',array(':visible'=>1)),//other conditions if any                                    
                    'fields'=>array(//declaration of fields
                            'text'=>'title',//no `text` column, use `title` instead
                            'alt'=>false,//skip using `alt` column
                            'id_parent'=>'parent_id',//no `id_parent` column,use `parent_id` instead
                            'task'=>false,
                            'icon'=>false,
                            'url'=>array('/theme/view',array('id'=>'id'))
                    ),
            ));
            ?>
        </div>
    </div>
    <div id="colTwo"> 
        <?php echo $content; ?> 
    </div>
</div>

<!-- page -->

<div id="footer">
    <ul id="left2">
        <ul id="right2"></ul>
        <br />
        <p>ХНТУСГ &copy; <?php echo date('Y'); ?> <br/></p>
    </ul>
</div>
</body>
</html>
